package com.tomtop.config;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;

import com.tomtop.core.utils.JSONUtils;

@ConfigurationProperties(prefix = "website")
public class WebSiteListConfig implements InitializingBean {
	static Logger log = LoggerFactory.getLogger(WebSiteListConfig.class);
	
	@Override
	public void afterPropertiesSet() throws Exception {
		log.info("默认选中的站点:  " + WebSiteListConfig.getDefault());
		log.info("站点配置列表 :  " + JSONUtils.toJSONString(WebSiteListConfig.getSiteList()));
	}
	
	private static String _default;
	private static Map<String, WebSite> sites;

	public static String getDefault() {
		return _default;
	}

	public void setDefault(String _default) {
		WebSiteListConfig._default = _default;
	}

	public static Map<String, WebSite> getSiteList() {
		return sites;
	}

	public Map<String, WebSite> getSites() {
		return sites;
	}

	public void setSites(Map<String, WebSite> sites) {
		WebSiteListConfig.sites = sites;
	}
}